package com.ruoyi.goods.GoodsStore.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.goods.GoodsStore.service.IStockBillItemService;
import lombok.Getter;
import lombok.Setter;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 出入库单据对象 stock_bill
 *
 * @author godlei
 * @date 2022-11-27
 */
@TableName("stock_bill")
@Getter
@Setter
public class StockBill extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 单据流水号 */
    @Excel(name = "单据流水号")
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Long id;

    /** 类型, 0 入库, 1 出库 */
    @Excel(name = "类型, 0 入库, 1 出库")
    @TableField("type")
    private Integer type;

    /** 仓库id */
    @Excel(name = "仓库id")
    @TableField("store_id")
    private String storeId;

    /** 出入库时间 */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "出入库时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("busi_date")
    private Date busiDate;

    /** 0 正常, -1 作废 */
    @Excel(name = "0 正常, -1 作废")
    @TableField("status")
    private Integer status;

    /** 操作时间 */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("operate_date")
    private Date operateDate;

    /** 操作人 */
    @Excel(name = "操作人")
    @TableField("operator_id")
    private Long operatorId;
    @Excel(name = "操作人名")
    @TableField(exist = false)
    private String operatorName;
    @Excel(name = "仓库名")
    @TableField(exist = false)
    private String storeName;
    @Excel(name = "备注")
    private String remark;
    @Excel(name = "总数量")
    @TableField(exist = false)
    private Long totalCount;
    @Excel(name = "金额")
    @TableField(exist = false)
    private BigDecimal totalAmount;
    @TableField(exist = false)
    private List<StockBillItem> item;
}
